﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ComponentFactory.Krypton.Toolkit;
using Microsoft.ApplicationBlocks.Data;
using System.Data.OleDb;
namespace XBYTestManagement
{
    public partial class FrmMethodSteps : KryptonForm
    {
        public String Content = "";
        public String Standard = "";
        public String File = "";
        public FrmMethodSteps()
        {
            InitializeComponent();
            dgv.AutoGenerateColumns = false;
        }

        private void MethodBind(int id)
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("select * from testMethod ");
            OleDbParameter[] param = new OleDbParameter[1];
            param[0] = new OleDbParameter();
            param[0].ParameterName = "@StepContentID";
            param[0].Value = id;
            DataSet ds = OleDbHelper.ExecuteDataset(OleDbHelper.connectionString, CommandType.Text, sb.ToString(), param);
            dgv.DataSource = ds.Tables[0].DefaultView;

        }

        private void dgv_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex == -1) return;
            Content = dgv.Rows[e.RowIndex].Cells["content"].ToString();
            Standard = dgv.Rows[e.RowIndex].Cells["standard"].ToString();
            File = dgv.Rows[e.RowIndex].Cells["exampleFile"].ToString();
            this.Close();
        }

    }
}
